package com.admin.model.dto;

import com.admin.model.base.BaseDto;
import com.admin.model.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * (TypeMapping)实体类
 *
 * @author caixiaofeng
 * @since 2021-03-13 21:49:23
 */
@ApiModel("类型映射")
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class TypeMappingDto extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 799185931498288352L;
    /**
    * id
    */
    @NotNull(message = "id不能为空",groups = BaseDto.Update.class)
    @Null(message = "id必须为空",groups = BaseDto.Create.class)
    @ApiModelProperty("id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
    * 数据库字段类型
    */
    @ApiModelProperty("数据库字段类型")
    private String databaseType;
    /**
    * java字段类型
    */
    @ApiModelProperty("java字段类型")
    private String javaType;
    /**
    * jdbc字段类型
    */
    @ApiModelProperty("jdbc字段类型")
    private String jdbcType;
}